| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

Public Member Functions | List of all members
nkGraphics::Frustum Class Referencefinal

Defines a frustum. More...

## Public Member Functions
| Frustum () noexcept
| Frustum (const Frustum &other) noexcept
| ~Frustum ()
const nkMaths::Vector & | getPlane (unsigned int index) const
bool | getIsInfiniteZ () const
void | setPlane (const nkMaths::Vector &plane, unsigned int index)
void | buildFrustum (const nkMaths::Matrix &viewMat, const nkMaths::Matrix &projMat)

## Detailed Description

Defines a frustum.

A Frustum is a primitive that can for instance describe a camera's view range. Within Nilkins, the planes are in this order : left, right, bottom, top, near, far. Directions should be normalized and pointing inside the frustum's volume.

## Constructor & Destructor Documentation

## ◆ Frustum() [1/2]

nkGraphics::Frustum::Frustum | ( |  | ) |
| noexcept

Default constructor.

## ◆ Frustum() [2/2]

nkGraphics::Frustum::Frustum | ( | const Frustum & | other | ) |
| noexcept

Copy constructor.

Parameters

  other | The frustum to copy.

## ◆ ~Frustum()

nkGraphics::Frustum::~Frustum | ( |  | ) |

Destructor.

## Member Function Documentation

## ◆ getPlane()

const nkMaths::Vector& nkGraphics::Frustum::getPlane | ( | unsigned int | index | ) | const

Gives access to the planes forming the frustum.

Parameters

  index | The index of the plane to retrieve. Will be clamped to [0, 6].

Returns
  The normal describing the plane requested.

## ◆ getIsInfiniteZ()

bool nkGraphics::Frustum::getIsInfiniteZ | ( |  | ) | const

Returns
  Whether the frustum has been built using an infinite Z projection matrix (true) or not (false).

Remarks
  If true, the far plane (at index 5) can safely be ignored during bounding tests.

## ◆ setPlane()

void nkGraphics::Frustum::setPlane | ( | const nkMaths::Vector & | plane,
|  | unsigned int | index
| ) |  |

Sets a plane.

Parameters

  plane | The new plane to set.
  index | The index of the plane to set.

## ◆ buildFrustum()

void nkGraphics::Frustum::buildFrustum | ( | const nkMaths::Matrix & | viewMat,
|  | const nkMaths::Matrix & | projMat
| ) |  |

Builds the frustum for a given view and projection matrix.

The documentation for this class was generated from the following file:

- Documentation/Headers/NilkinsGraphics/Cameras/Frustum.h